﻿namespace BrainTechLLC
{
    using System;
    using System.ComponentModel;
    using System.IO;
    using System.Net;
    using System.Net.Sockets;

    //public class ObjectEventArgs : EventArgs
    //{
    //    public ICommunicationsMessage Message { get; set; }
    //    public ObjectEventArgs(ICommunicationsMessage message) { Message = message; }
    //}
    //public class ObjectEventArgsNonRef<T> : EventArgs
    //{
    //    public T obj { get; set; }
    //    public ObjectEventArgsNonRef(T item) { obj = item; }
    //}
    //public class ObjectEventArgsNonRef<T1, T2> : EventArgs
    //{
    //    public T1 obj1 { get; set; }
    //    public T2 obj2 { get; set; }
    //    public ObjectEventArgsNonRef(T1 item1, T2 item2) { obj1 = item1; obj2 = item2; }
    //}
    //public class ObjectEventArgsNonRef<T1, T2, T3> : EventArgs
    //{
    //    public T1 obj1 { get; set; }
    //    public T2 obj2 { get; set; }
    //    public T3 obj3 { get; set; }
    //    public ObjectEventArgsNonRef(T1 item1, T2 item2, T3 item3) { obj1 = item1; obj2 = item2; obj3 = item3; }
    //}
    //public class ObjectEventArgs<T> : EventArgs where T : class
    //{
    //    public T obj { get; set; }
    //    public ObjectEventArgs(T item) { obj = item; }
    //}
    //public class ObjectEventArgs<T1, T2> : EventArgs
    //    where T1 : class
    //    where T2 : class
    //{
    //    public T1 obj1 { get; set; }
    //    public T2 obj2 { get; set; }
    //    public ObjectEventArgs(T1 item1, T2 item2) { obj1 = item1; obj2 = item2; }
    //}
    //public class ObjectEventArgs<T1, T2, T3> : EventArgs
    //    where T1 : class
    //    where T2 : class
    //    where T3 : class
    //{
    //    public T1 obj1 { get; set; }
    //    public T2 obj2 { get; set; }
    //    public T3 obj3 { get; set; }
    //    public ObjectEventArgs(T1 item1, T2 item2, T3 item3) { obj1 = item1; obj2 = item2; obj3 = item3; }
    //}

    public interface ICommunicationsMessage
    {
        #region Properties

        IMessageHeader Header
        {
            get; set;
        }

        object MessageContents
        {
            get; set;
        }

        int MessageType
        {
            get;
        }

        #endregion Properties

        #region Methods

        byte[] ReadBytesForTransmission();

        #endregion Methods
    }

    public interface IMessageHeader
    {
        #region Properties

        int HeaderSize
        {
            get;
        }

        int MessageSize
        {
            get; set;
        }

        int MessageType
        {
            get; set;
        }

        #endregion Properties

        #region Methods

        void ReadFromStream(BinaryReader binaryReader);

        void WriteHeaderToStream(MemoryStream ms);

        #endregion Methods
    }
}